package apiday01.homework.string;

public class StringDemo {
    public static void main(String[] args) {
        String s1 = "1234abc";
        String s2 = "1234abc";
        String s3 = "1234abc";
        System.out.println(s1==s2);//true
        System.out.println(s1==s3);//true
        String s4 = new String("1234abc");
        System.out.println(s1==s4);//false
        System.out.println("---------------------");

        String s5 = "1234";
        String s6 = s5 + "abc";
        System.out.println(s6==s1);//false
        String s7 = "1234" + "abc";
        System.out.println(s7==s2);//true
        System.out.println("---------------------");

        String s8 = "123abc";
        String s9 = new String("123abc");
        System.out.println(s8==s9);//false
        System.out.println(s8.equals(s9));//true


    }
}
